package org.grottarossa.domain;

import java.util.Set;

import javax.jdo.annotations.FetchGroup;
import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.IdentityType;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;
import javax.jdo.annotations.Serialized;

@PersistenceCapable(identityType=IdentityType.DATASTORE,detachable="true")
@FetchGroup(name="task-fetch-group", members={
		@Persistent(name="name"),
		@Persistent(name="description")	,	
		@Persistent(name="id")	,	
		@Persistent(name="category") ,
		@Persistent(name="casefolder")
		}
)
public class Task 
{
	@PrimaryKey
	@Persistent(valueStrategy=IdGeneratorStrategy.INCREMENT)

	@Serialized
	private String id;	

	@Persistent
	private String name;

	@Persistent
	private String description;

	//@Persistent
	private Category category;
	
	//@Persistent(defaultFetchGroup = "true")
	private Set<Field> fields;
	
	//@Persistent(defaultFetchGroup = "true")	
	private Set<Task> tasks;

	//@Persistent
	private CaseFolder casefolder;
	
	public void update(Task task)
	{
		
		
	}
	
	/**
	 * @param name the name to set
	 */
	public void setName(String name) {
		this.name = name;
	}
	/**
	 * @return the name
	 */
	public String getName() {
		return name;
	}
	/**
	 * @param description the description to set
	 */
	public void setDescription(String description) {
		this.description = description;
	}
	/**
	 * @return the description
	 */
	public String getDescription() {
		return description;
	}
	/**
	 * @param category the category to set
	 */
	public void setCategory(Category category) {
		this.category = category;
	}
	/**
	 * @return the category
	 */
	public Category getCategory() {
		return category;
	}
	
	/**
	 * @return the id
	 */
	public String getId() {
		return id;
	}
	/**
	 * @param casefolder the casefolder to set
	 */
	public void setCasefolder(CaseFolder casefolder) {
		this.casefolder = casefolder;
	}
	/**
	 * @return the casefolder
	 */
	public CaseFolder getCasefolder() {
		return casefolder;
	}
	/**
	 * @param fields the fields to set
	 */
	public void setFields(Set<Field> fields) {
		this.fields = fields;
	}
	/**
	 * @return the fields
	 */
	public Set<Field> getFields() {
		return fields;
	}
	/**
	 * @param tasks the tasks to set
	 */
	public void setTasks(Set<Task> tasks) {
		this.tasks = tasks;
	}
	/**
	 * @return the tasks
	 */
	public Set<Task> getTasks() {
		return tasks;
	}
	
	

}
